//
//  PredepositInfoModel.swift
//  XiaoJingMallSwift
//
//  Created by beisheng03 on 2017/9/6.
//  Copyright © 2017年 beisheng. All rights reserved.
//

import UIKit

class PredepositInfoModel: NSObject {

    
    var total_predeposit = "-999"
    var freeze_predeposit = "-999"
    var have_card = "-999"
    var available_predeposit = "-999"
    var card_info : BankCardInfoModel?
    
    init(dic : [String : AnyObject]) {
        super.init()
        
        setValuesForKeys(dic)
        
    }
    
    
    override func  setValue(_ value: Any?, forKey key: String) {
        
        if key == "card_info" {
            
            if let temp = value as? [String : AnyObject]{
                
                card_info = BankCardInfoModel(dic:temp )
                
            }
            
        } else {
            
            
            super.setValue(value, forKey: key)
        }
        
    }
    
    override func setValue(_ value: Any?, forUndefinedKey key: String) {
        
        
    }
    
    
    //在swift中想要打印对象要以下重写属性
    override var description: String{
        let keys = ["total_predeposit","freeze_predeposit","have_card","available_predeposit","card_info"]
        let dic = dictionaryWithValues(forKeys: keys)
        return "\(dic)"
    }


}
